﻿namespace ExamV5.WAPPage
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmSetNextTask : Page
    {
        protected GridView DataGridA;
        protected GridView DataGridB;
        protected GridView DataGridC;
        protected GridView DataGridD;
        protected GridView DataGridE;
        protected GridView DataGridJ;
        protected HtmlInputHidden EndTime;
        protected HtmlForm Form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        protected Label labAFen;
        protected Label labATitle;
        protected Label labBFen;
        protected Label labBTitle;
        protected Label labCFen;
        protected Label labCountWriteANY;
        protected Label labCountWriteAY;
        protected Label labCountWriteBY;
        protected Label labCountWriteCY;
        protected Label labCountWriteDY;
        protected Label labCountWriteFY;
        protected Label labCountWriteJY;
        protected Label labCountWriteSY;
        protected Label labCountWriteTY;
        protected Label labCTitle;
        protected Label labDFen;
        protected Label labDTitle;
        protected Label labEFen;
        protected Label labETitle;
        protected Label labFTitle;
        protected Label labGTitle;
        protected Label labHTitle;
        protected Label labJFen;
        protected Label labJTitle;
        protected Label labUserInfo;
        protected Label labWriteANY;
        protected Label labWriteAY;
        protected Label labWriteBY;
        protected Label labWriteCY;
        protected Label labWriteDY;
        protected Label labWriteFY;
        protected Label labWriteJY;
        protected Label labWriteN;
        protected Label labWriteSY;
        protected Label labWriteTY;
        protected Label labWriteY;
        private PublicFun publicFun_0 = new PublicFun();
        protected HtmlInputHidden StartTime;
        private string string_0 = "";
        private string string_1 = "";
        private string string_2 = "";
        private string string_3 = "";
        private string string_4 = "";
        private string string_5 = "";
        protected HtmlInputHidden SumTime;
        protected HtmlInputHidden txtCheckID;
        protected HtmlInputHidden txtHideComm;
        protected HtmlInputHidden txtHideEnter;

        private void method_0()
        {
            int num = 0;
            string cmdText = "select ParmName from SysParmInfo where ParmMemo='RubricType' and ParmValue<>'I' order by ParmValue";
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand(cmdText, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            while (reader.Read())
            {
                switch (num)
                {
                    case 0:
                        this.labATitle.Text = reader["ParmName"].ToString();
                        break;

                    case 1:
                        this.labBTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 2:
                        this.labCTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 3:
                        this.labDTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 4:
                        this.labETitle.Text = reader["ParmName"].ToString();
                        break;

                    case 5:
                        this.labFTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 6:
                        this.labGTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 7:
                        this.labHTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 9:
                        this.labJTitle.Text = reader["ParmName"].ToString();
                        break;
                }
                num++;
            }
            if (this.labATitle.Text.Trim() == "")
            {
                this.labATitle.Text = "单选题";
            }
            if (this.labBTitle.Text.Trim() == "")
            {
                this.labBTitle.Text = "多选题";
            }
            if (this.labCTitle.Text.Trim() == "")
            {
                this.labCTitle.Text = "判断题";
            }
            if (this.labDTitle.Text.Trim() == "")
            {
                this.labDTitle.Text = "填空题";
            }
            if (this.labETitle.Text.Trim() == "")
            {
                this.labETitle.Text = "简答题";
            }
            if (this.labFTitle.Text.Trim() == "")
            {
                this.labFTitle.Text = "作文题";
            }
            if (this.labGTitle.Text.Trim() == "")
            {
                this.labGTitle.Text = "论述题";
            }
            if (this.labHTitle.Text.Trim() == "")
            {
                this.labHTitle.Text = "分析题";
            }
            if (this.labJTitle.Text.Trim() == "")
            {
                this.labJTitle.Text = "综合题";
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
        }

        private void method_1()
        {
            this.method_0();
            string str = "";
            str = "<table   borderColor='#cccccc' cellSpacing='0' borderColorDark='#cccccc' cellPadding='0' width='100%' align='center' border='1' style='border-style:Solid;'>";
            str = str + "<tr height='30'><td align='left' bgcolor='#5AA6E4'>";
            string str2 = this.string_4.Replace(" ", "") + this.string_3.Replace(" ", "");
            if (str2.Trim() != "")
            {
                str2 = str2.Substring(0, str2.Length - 1);
                if (this.string_2.Trim() == "A")
                {
                    this.labATitle.Visible = true;
                    this.labATitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labATitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;说明:(说明:选择一项正确的答案)</font></td></tr></table><br>";
                    this.method_2(str2);
                }
                if (this.string_2.Trim() == "B")
                {
                    this.labBTitle.Visible = true;
                    this.labBTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labBTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:选择多项正确的答案)</font></td></tr></table><br>";
                    this.method_3(str2);
                }
                if (this.string_2.Trim() == "C")
                {
                    this.labCTitle.Visible = true;
                    this.labCTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labCTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:选择一项正确的答案)</font></td></tr></table><br>";
                    this.method_4(str2);
                }
                if (this.string_2.Trim() == "D")
                {
                    this.labDTitle.Visible = true;
                    this.labDTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labDTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:每答对一空都可得分)</font></td></tr></table><br>";
                    this.method_5(str2);
                }
                if (this.string_2.Trim() == "E")
                {
                    this.labETitle.Visible = true;
                    this.labETitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labETitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_6(str2);
                }
                if (this.string_2.Trim() == "F")
                {
                    this.labFTitle.Visible = true;
                    this.labFTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labFTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_6(str2);
                }
                if (this.string_2.Trim() == "G")
                {
                    this.labGTitle.Visible = true;
                    this.labGTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labGTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_6(str2);
                }
                if (this.string_2.Trim() == "H")
                {
                    this.labHTitle.Visible = true;
                    this.labHTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labHTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_6(str2);
                }
                if (this.string_2.Trim() == "J")
                {
                    this.labJTitle.Visible = true;
                    this.labJTitle.Text = str + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labJTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_7(str2);
                }
            }
            else
            {
                base.Response.Write("<script>alert('对不起,参数不正确！')</script>");
                this.Page.Response.Write("<script>setTimeout(function(){window.location='TaskInfoList.aspx'},500)</script>");
            }
        }

        private void method_10()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridC.Rows.Count; i++)
            {
                Label label = (Label) this.DataGridC.Rows[i].FindControl("labCID");
                RadioButtonList list = (RadioButtonList) this.DataGridC.Rows[i].FindControl("RBLSetB");
                if (list.SelectedIndex == -1)
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
                else if (list.SelectedItem.Value == "N")
                {
                    this.string_1 = this.string_1 + label.Text.Trim() + ",";
                }
                else
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
            }
        }

        private void method_11()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridD.Rows.Count; i++)
            {
                Label label = (Label) this.DataGridD.Rows[i].FindControl("labDID");
                RadioButtonList list = (RadioButtonList) this.DataGridD.Rows[i].FindControl("RBLSetF");
                if (list.SelectedIndex != -1)
                {
                    if (!(list.SelectedItem.Value == "N"))
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                    }
                    else
                    {
                        this.string_1 = this.string_1 + label.Text.Trim() + ",";
                    }
                }
                else
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
            }
        }

        private void method_12()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridE.Rows.Count; i++)
            {
                Label label = (Label) this.DataGridE.Rows[i].FindControl("labEID");
                RadioButtonList list = (RadioButtonList) this.DataGridE.Rows[i].FindControl("RBLSetC");
                if (list.SelectedIndex == -1)
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
                else if (!(list.SelectedItem.Value == "N"))
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
                else
                {
                    this.string_1 = this.string_1 + label.Text.Trim() + ",";
                }
            }
        }

        private void method_13()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridJ.Rows.Count; i++)
            {
                Label label = (Label) this.DataGridJ.Rows[i].FindControl("labJID");
                RadioButtonList list = (RadioButtonList) this.DataGridJ.Rows[i].FindControl("RBLSetAN");
                if (list.SelectedIndex != -1)
                {
                    if (!(list.SelectedItem.Value == "N"))
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                    }
                    else
                    {
                        this.string_1 = this.string_1 + label.Text.Trim() + ",";
                    }
                }
                else
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
            }
        }

        private void method_2(string string_6)
        {
            this.DataGridA.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ") order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "SRubric");
            this.DataGridA.DataSource = dataSet.Tables["SRubric"].DefaultView;
            this.DataGridA.DataBind();
            for (int i = 0; i < this.DataGridA.Rows.Count; i++)
            {
                string[] strArray = dataSet.Tables["SRubric"].Rows[i]["OptionAnswer"].ToString().Split(new char[] { '#' });
                Label label2 = (Label) this.DataGridA.Rows[i].FindControl("labAID");
                RadioButtonList list2 = (RadioButtonList) this.DataGridA.Rows[i].FindControl("RBLSetS");
                Image image = (Image) this.DataGridA.Rows[i].FindControl("ImgOKAnswerS");
                image.Visible = true;
                list2.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    image.ImageUrl = "../Image/images/app/ks_false.png";
                    image.CssClass = "signet_wrong";
                    list2.SelectedIndex = 0;
                }
                else
                {
                    image.ImageUrl = "../Image/images/app/ks_ture.png";
                    image.CssClass = "signet_right";
                    list2.SelectedIndex = 1;
                }
                Label label = (Label) this.DataGridA.Rows[i].FindControl("labADataTitle");
                Label label1 = (Label) this.DataGridA.Rows[i].FindControl("labAFileName");
                Label label4 = (Label) this.DataGridA.Rows[i].FindControl("labAVodFile");
                RadioButtonList list = (RadioButtonList) this.DataGridA.Rows[i].FindControl("RBLAData");
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
                if (strArray[0].Trim() != "")
                {
                    strArray[0] = "A、" + strArray[0];
                    ListItem item6 = new ListItem(strArray[0].Replace("＃", "#"), "A");
                    list.Items.Insert(0, item6);
                }
                if (strArray[1].Trim() != "")
                {
                    strArray[1] = "B、" + strArray[1];
                    ListItem item5 = new ListItem(strArray[1].Replace("＃", "#"), "B");
                    list.Items.Insert(1, item5);
                }
                if (strArray[2].Trim() != "")
                {
                    strArray[2] = "C、" + strArray[2];
                    ListItem item4 = new ListItem(strArray[2].Replace("＃", "#"), "C");
                    list.Items.Insert(2, item4);
                }
                if (strArray[3].Trim() != "")
                {
                    strArray[3] = "D、" + strArray[3];
                    ListItem item3 = new ListItem(strArray[3].Replace("＃", "#"), "D");
                    list.Items.Insert(3, item3);
                }
                if (strArray[4].Trim() != "")
                {
                    strArray[4] = "E、" + strArray[4];
                    ListItem item2 = new ListItem(strArray[4].Replace("＃", "#"), "E");
                    list.Items.Insert(4, item2);
                }
                if (strArray[5].Trim() != "")
                {
                    strArray[5] = "F、" + strArray[5];
                    ListItem item = new ListItem(strArray[5].Replace("＃", "#"), "F");
                    list.Items.Insert(5, item);
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_3(string string_6)
        {
            this.DataGridB.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ")  order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "BRubric");
            this.DataGridB.DataSource = dataSet.Tables["BRubric"].DefaultView;
            this.DataGridB.DataBind();
            for (int i = 0; i < this.DataGridB.Rows.Count; i++)
            {
                string[] strArray = dataSet.Tables["BRubric"].Rows[i]["OptionAnswer"].ToString().Split(new char[] { '#' });
                Image image = (Image) this.DataGridB.Rows[i].FindControl("ImgOKAnswerD");
                image.Visible = true;
                Label label2 = (Label) this.DataGridB.Rows[i].FindControl("labBID");
                RadioButtonList list2 = (RadioButtonList) this.DataGridB.Rows[i].FindControl("RBLSetD");
                list2.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    image.ImageUrl = "../Image/images/app/ks_false.png";
                    image.CssClass = "signet_wrong";
                    list2.SelectedIndex = 0;
                }
                else
                {
                    image.ImageUrl = "../Image/images/app/ks_ture.png";
                    image.CssClass = "signet_right";
                    list2.SelectedIndex = 1;
                }
                Label label = (Label) this.DataGridB.Rows[i].FindControl("labBDataTitle");
                CheckBoxList list = (CheckBoxList) this.DataGridB.Rows[i].FindControl("CBLBData");
                if (strArray[0].Trim() != "")
                {
                    strArray[0] = "A、" + strArray[0];
                    list.Items.Add(strArray[0].Replace("＃", "#"));
                }
                if (strArray[1].Trim() != "")
                {
                    strArray[1] = "B、" + strArray[1];
                    list.Items.Add(strArray[1].Replace("＃", "#"));
                }
                if (strArray[2].Trim() != "")
                {
                    strArray[2] = "C、" + strArray[2];
                    list.Items.Add(strArray[2].Replace("＃", "#"));
                }
                if (strArray[3].Trim() != "")
                {
                    strArray[3] = "D、" + strArray[3];
                    list.Items.Add(strArray[3].Replace("＃", "#"));
                }
                if (strArray[4].Trim() != "")
                {
                    strArray[4] = "E、" + strArray[4];
                    list.Items.Add(strArray[4].Replace("＃", "#"));
                }
                if (strArray[5].Trim() != "")
                {
                    strArray[5] = "F、" + strArray[5];
                    list.Items.Add(strArray[5].Replace("＃", "#"));
                }
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_4(string string_6)
        {
            this.DataGridC.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ")  order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "CRubric");
            this.DataGridC.DataSource = dataSet.Tables["CRubric"].DefaultView;
            this.DataGridC.DataBind();
            for (int i = 0; i < this.DataGridC.Rows.Count; i++)
            {
                dataSet.Tables["CRubric"].Rows[i]["OptionAnswer"].ToString().Split(new char[] { '#' });
                Image image = (Image) this.DataGridC.Rows[i].FindControl("ImgOKAnswerB");
                image.Visible = true;
                Label label2 = (Label) this.DataGridC.Rows[i].FindControl("labCID");
                RadioButtonList list = (RadioButtonList) this.DataGridC.Rows[i].FindControl("RBLSetB");
                list.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    list.SelectedIndex = 0;
                    image.ImageUrl = "../Image/images/app/ks_false.png";
                    image.CssClass = "signet_wrong";
                }
                else
                {
                    list.SelectedIndex = 1;
                    image.ImageUrl = "../Image/images/app/ks_ture.png";
                    image.CssClass = "signet_right";
                }
                Label label = (Label) this.DataGridC.Rows[i].FindControl("labCDataTitle");
                RadioButtonList list1 = (RadioButtonList) this.DataGridC.Rows[i].FindControl("RBLCData");
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_5(string string_6)
        {
            this.DataGridD.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ")  order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "DRubric");
            this.DataGridD.DataSource = dataSet.Tables["DRubric"].DefaultView;
            this.DataGridD.DataBind();
            for (int i = 0; i < this.DataGridD.Rows.Count; i++)
            {
                RadioButtonList list = (RadioButtonList) this.DataGridD.Rows[i].FindControl("RBLSetF");
                list.SelectedIndex = -1;
                Label label2 = (Label) this.DataGridD.Rows[i].FindControl("labDID");
                Label label3 = (Label) this.DataGridD.Rows[i].FindControl("labDOKAnswer");
                label3.Visible = true;
                label3.Text = "<br><br><font color=red>正确答案：</font>" + label3.Text.Trim().Replace("#", "  &nbsp;&nbsp;");
                list.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    list.SelectedIndex = 0;
                }
                else
                {
                    list.SelectedIndex = 1;
                }
                Label label = (Label) this.DataGridD.Rows[i].FindControl("labDDataTitle");
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_6(string string_6)
        {
            this.DataGridE.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ")  order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "ERubric");
            this.DataGridE.DataSource = dataSet.Tables["ERubric"].DefaultView;
            this.DataGridE.DataBind();
            for (int i = 0; i < this.DataGridE.Rows.Count; i++)
            {
                RadioButtonList list = (RadioButtonList) this.DataGridE.Rows[i].FindControl("RBLSetC");
                list.SelectedIndex = -1;
                Label label2 = (Label) this.DataGridE.Rows[i].FindControl("labEID");
                Label label3 = (Label) this.DataGridE.Rows[i].FindControl("labEOKAnswer");
                label3.Visible = true;
                label3.Text = "<br><br><font color=red>正确答案：</font>" + label3.Text.Trim();
                list.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    list.SelectedIndex = 0;
                }
                else
                {
                    list.SelectedIndex = 1;
                }
                Label label = (Label) this.DataGridE.Rows[i].FindControl("labEDataTitle");
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_7(string string_6)
        {
            this.DataGridJ.Visible = true;
            int num = 0;
            string selectCommandText = "Select ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_6 + ")  order by ID";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "JRubric");
            this.DataGridJ.DataSource = dataSet.Tables["JRubric"].DefaultView;
            this.DataGridJ.DataBind();
            for (int i = 0; i < this.DataGridJ.Rows.Count; i++)
            {
                RadioButtonList list = (RadioButtonList) this.DataGridJ.Rows[i].FindControl("RBLSetJ");
                list.SelectedIndex = -1;
                Label label2 = (Label) this.DataGridJ.Rows[i].FindControl("labJID");
                Label label3 = (Label) this.DataGridJ.Rows[i].FindControl("labJOKAnswer");
                label3.Visible = true;
                label3.Text = "<br><br><font color=red>正确答案：</font>" + label3.Text.Trim();
                list.SelectedIndex = -1;
                if (this.string_4.IndexOf(label2.Text.Trim() + ",") <= -1)
                {
                    list.SelectedIndex = 0;
                }
                else
                {
                    list.SelectedIndex = 1;
                }
                Label label = (Label) this.DataGridJ.Rows[i].FindControl("labJDataTitle");
                num++;
                label.Text = num.ToString() + "、" + label.Text.ToString();
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_8()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridA.Rows.Count; i++)
            {
                try
                {
                    Label label = (Label) this.DataGridA.Rows[i].FindControl("labAID");
                    RadioButtonList list = (RadioButtonList) this.DataGridA.Rows[i].FindControl("RBLSetS");
                    if (list.SelectedIndex == -1)
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                    }
                    else if (list.SelectedItem.Value == "N")
                    {
                        this.string_1 = this.string_1 + label.Text.Trim() + ",";
                    }
                    else
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                    }
                }
                catch
                {
                }
            }
        }

        private void method_9()
        {
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridB.Rows.Count; i++)
            {
                Label label = (Label) this.DataGridB.Rows[i].FindControl("labBID");
                RadioButtonList list = (RadioButtonList) this.DataGridB.Rows[i].FindControl("RBLSetD");
                if (list.SelectedIndex != -1)
                {
                    if (!(list.SelectedItem.Value == "N"))
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                    }
                    else
                    {
                        this.string_1 = this.string_1 + label.Text.Trim() + ",";
                    }
                }
                else
                {
                    this.string_0 = this.string_0 + label.Text.Trim() + ",";
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                this.int_0 = Convert.ToInt32(base.Request["SubjectID"].ToString());
                this.string_2 = base.Request["RubricType"].ToString();
                this.string_5 = base.Server.UrlDecode(base.Request["SubjectName"].ToString()).Replace("│", "").Replace("├", "");
                this.string_4 = base.Request["WriteY"].ToString();
                this.string_3 = base.Request["WriteN"].ToString();
                if (this.string_4 == "")
                {
                    this.string_4 = " ";
                }
                if (this.string_3 == "")
                {
                    this.string_3 = " ";
                }
                this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString + "设置下次练习范围";
                if (base.IsPostBack)
                {
                    try
                    {
                        if (this.DataGridA.Visible)
                        {
                            this.method_8();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYS='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNS='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.DataGridB.Visible)
                        {
                            this.method_9();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYD='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricND='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.DataGridC.Visible)
                        {
                            this.method_10();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYB='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNB='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.DataGridD.Visible)
                        {
                            this.method_11();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYF='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNF='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (!(this.DataGridE.Visible ? !this.labETitle.Visible : true))
                        {
                            this.method_12();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYA='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNA='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.labFTitle.Visible)
                        {
                            this.method_12();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYC='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNC='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.labGTitle.Visible)
                        {
                            this.method_12();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYT='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNT='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.labHTitle.Visible)
                        {
                            this.method_12();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYAN='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNAN='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                        if (this.DataGridJ.Visible)
                        {
                            this.method_13();
                            this.publicFun_0.ExecuteSql(string.Concat(new object[] { "update StudyHistory set RubricYJ='", this.labWriteY.Text.Replace(this.string_4, this.string_1), "',RubricNJ='", this.labWriteN.Text.Replace(this.string_3, this.string_0), "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }));
                        }
                    }
                    catch
                    {
                    }
                    if (this.txtHideComm.Value.Trim() == "EndExam")
                    {
                        string str = base.Request.Url.ToString();
                        str = str.Substring(0, str.LastIndexOf('/') + 1);
                        base.Response.Redirect(str + "FrmStudyCenter.aspx");
                    }
                }
                else if (this.publicFun_0.ReturnPaperData() != "Yes")
                {
                    base.Response.Write("<script>alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')</script>");
                }
                else
                {
                    this.labUserInfo.Text = "设置〖" + this.string_5 + "〗重复练习试题";
                    this.method_1();
                    if (this.string_2.Trim() == "A")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYS from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYS");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNS from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNS");
                    }
                    if (this.string_2.Trim() == "B")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYD from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYD");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricND from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricND");
                    }
                    if (this.string_2.Trim() == "C")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYB from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYB");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNB from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNB");
                    }
                    if (this.string_2.Trim() == "D")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYF from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYF");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNF from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNF");
                    }
                    if (this.string_2.Trim() == "E")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYA from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYA");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNA from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNA");
                    }
                    if (this.string_2.Trim() == "F")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYC from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYC");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNC from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNC");
                    }
                    if (this.string_2.Trim() == "G")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYT from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYT");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNT from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNT");
                    }
                    if (this.string_2.Trim() == "H")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYAN from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYAN");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNAN from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNAN");
                    }
                    if (this.string_2.Trim() == "J")
                    {
                        this.labWriteY.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricYJ from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricYJ");
                        this.labWriteN.Text = this.publicFun_0.GetValues(string.Concat(new object[] { "select RubricNJ from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_0 }), "RubricNJ");
                    }
                    if (this.labWriteY.Text == "")
                    {
                        this.labWriteY.Text = " ";
                    }
                    if (this.labWriteN.Text == "")
                    {
                        this.labWriteN.Text = " ";
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

